﻿using Koala.Pro.CodeGenerator.UI.Common.Adapter;
using Koala.Pro.CodeGenerator.UI.Controls;
using Koala.Pro.CodeGenerator.UI.DatabaseModel.Schema;
using Koala.Pro.CodeGenerator.UI.Models;

namespace Koala.Pro.CodeGenerator.UI.Common.EntityProject
{
    public class SimpleEntityProject
    {
        public const string ProjectPath = "SimpleEntityProject/";

        public static void Execute(DatabaseInfo databaseInfo, List<string> selectedTableNames, IProgressCallback progress)
        {

        }

        public static List<FileNameAndCode> ExecuteString(DatabaseInfo databaseInfo, List<string> selectedTableNames, IProgressCallback progress)
        {
            var projectData = new ProjectData();
            projectData.Load();
            var list = new List<FileNameAndCode>();
            var adapter = new EntityAdapter(databaseInfo, selectedTableNames, "SimpleEntityProject/Templates/Entity/Entity.cs.vm");
            list.AddRange(adapter.ExecuteString());
            return list;
        }
    }
}
